package com.eorchis.module.auditing.ui.commond;

import java.io.Serializable;

import com.eorchis.core.basedao.entity.IBaseEntity;
import com.eorchis.core.ui.commond.ICommond;
import com.eorchis.module.auditing.domain.Auditing;
import com.eorchis.module.classuser.domain.ClassUser;
import com.eorchis.module.user.domain.User;
import com.eorchis.utils.DateUtil;
import com.eorchis.utils.utils.PropertyUtil;

import java.util.Date;

import org.hibernate.validator.constraints.NotBlank;


/**
 * Title: AuditingValidCommond<br>
 * Description: 班级审核人员信息ValidCommond<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * @author Max
 * @createDate 2013-12-31
 * @version $Revision$
 */
public class AuditingValidCommond implements ICommond {
	
	private Auditing auditing;
	private String userId;//审核人id
	private String userName;//审核人姓名
	private String auditingStateDateStr;//审核时间yyyy-MM-dd
	private String auditingStateStr;//审核时间yyyy-MM-dd HH:mm:ss
	private String classUserId;//培训班用户关系ID
	public AuditingValidCommond(){
		auditing = new Auditing();
	}
	
	public AuditingValidCommond(Auditing auditing){
		this.auditing = auditing;
	}

	public Serializable getEntityID() {
		return auditing.getAuditingId();
	}

	public IBaseEntity toEntity() {
		return auditing;
	}

	/**
	 * 获取ID
	 */	
	@NotBlank
	public String getAuditingId() {
		return auditing.getAuditingId();
	}
	/**
	 * 设置ID
	 */		
	public void setAuditingId(String auditingId) {
		auditing.setAuditingId(auditingId);
	}
	/**
	 * 获取审核状态
	 */	
	public Integer getAuditingState() {
		return auditing.getAuditingState();
	}
	/**
	 * 设置审核状态
	 */		
	public void setAuditingState(Integer auditingState) {
		auditing.setAuditingState(auditingState);
	}
	/**
	 * 获取审核意见
	 */	
	public String getAuditingOpinion() {
		return auditing.getAuditingOpinion();
	}
	/**
	 * 设置审核意见
	 */		
	public void setAuditingOpinion(String auditingOpinion) {
		auditing.setAuditingOpinion(auditingOpinion);
	}
	/**
	 * 获取日期
	 */	
	public Date getAuditingDate() {
		return auditing.getAuditingDate();
	}
	/**
	 * 设置日期
	 */		
	public void setAuditingDate(Date auditingDate) {
		auditing.setAuditingDate(auditingDate);
	}
	/**
	 * 获取审核人
	 */	
	public User getAuditingUser() {
		return auditing.getAuditingUser();
	}
	/**
	 * 设置审核人
	 */	
	public void setAuditingUser(User auditingUser) {
		auditing.setAuditingUser(auditingUser);
	}
	/**
	 * 获取班级人员对象
	 */	
	public ClassUser getClassUser() {
		return auditing.getClassUser();
	}
	/**
	 * 设置班级人员对象
	 */	
	public void setClassUser(ClassUser classUser) {
		auditing.setClassUser(classUser);
	}
	/**
	 * 审核人id
	 */
	public String getUserId() {
		return auditing.getAuditingUser().getUserId();
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	/**
	 * 班级人员id
	 */
	public String getClassUserId() {
		return classUserId;
	}

	public void setClassUserId(String classUserId) {
		this.classUserId = classUserId;
	}

	/**
	 * 审核人姓名
	 */
	public String getUserName() {
		return auditing.getAuditingUser().getUserName();
	}
	/**
	 * 审核时间
	 */
	public String getAuditingStateDateStr() {
		if(PropertyUtil.objectNotEmpty(auditing.getAuditingDate())){
			return DateUtil.getDateString(auditing.getAuditingDate(), "yyyy-MM-dd");
		}
		return "";
	}
	/**
	 * 审核时间
	 */
	public String getAuditingStateStr() {
		if(PropertyUtil.objectNotEmpty(auditing.getAuditingDate())){
			return DateUtil.getDateString(auditing.getAuditingDate(), "yyyy-MM-dd HH:mm:ss");
		}
		return "";
	}
}
